<template>
    <div>
      <el-table :data="questions" style="width: 100%">
        <el-table-column prop="QuestionID" label="题目ID" width="180"></el-table-column>
        <el-table-column prop="QuestionContent" label="题目内容"></el-table-column>
        <el-table-column prop="OptionA" label="选项A"></el-table-column>
        <el-table-column prop="OptionB" label="选项B"></el-table-column>
        <el-table-column prop="OptionC" label="选项C"></el-table-column>
        <el-table-column prop="OptionD" label="选项D"></el-table-column>
      </el-table>
    </div>
  </template>
  
  <script>
  import axios from 'axios';
  
  export default {
    data() {
      return {
        questions: []
      };
    },
    mounted() {
      this.fetchQuestions();
    },
    methods: {
      async fetchQuestions() {
        const response = await axios.get('/api/questions');
        this.questions = response.data;
      }
    }
  };
  </script>
  
  <style>
  </style>
  